<?php
declare (strict_types = 1);

namespace app\common\model\mysql;
/**
 * @mixin \think\Model
 */
class GoodsSku extends BaseModel
{
    public function goods()
    {
        return $this->hasOne(Goods::class, 'id', 'goods_id');
    }

    public function getNormalSkuByGoodsId(int $goodsId)
    {
        $where = [
            'goods_id' => $goodsId,
            'status'   => config('status.mysql.table_normal')
        ];
        $res   = $this->where($where)->select();
        return $res;
    }
}
